package com.fita.admin.service.order;

import com.fita.admin.entity.security.Login;
import com.fita.admin.service.DataService;
import com.fita.entity.order.OrderPayType;
import com.fita.entity.order.reverse.ReverseOrder;
import com.fita.entity.order.reverse.ReverseOrderType;
import com.fita.entity.order.reverse.aviation.AviationRequest;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @description:
 * @author: 11200
 * @date: 2019/8/22
 */
public interface ReverseOrderService extends DataService<ReverseOrder> {

    /**
     * 修改价格
     * @param reverseOrderId
     * @param price
     * @param costPrice
     * @param lastPayTime
     */
    void editPrice(Long reverseOrderId, BigDecimal price, BigDecimal costPrice, Date lastPayTime);

    /**
     * 发送消息到客户
     * @param reverseOrderId
     */
    void sendMessageToClient(Long reverseOrderId);

    /**
     * 创建代理申请
     * @param reverseOrderId
     * @return
     */
    Long createAgentApply(Long reverseOrderId);

    /**
     * 修改预定
     * @param reverseOrderId
     * @param reverseOrder
     */
    ReverseOrder editBook(Long reverseOrderId, ReverseOrder reverseOrder);

    /**
     *
     * 标记支付
     * @param orderId
     * @param payCode
     * @param payTime
     * @param price
     * @param login
     * @param payType
     * @param payPic
     */
    ReverseOrder markPay(Long orderId, String payCode, Date payTime, BigDecimal price, Login login, OrderPayType payType, String payPic);

    /**
     * 取消订单
     * @param orderId
     * @param refundPrice
     * @return
     */
    ReverseOrder cancel(Long orderId, BigDecimal refundPrice);

    /**
     * 标记出票
     * @param orderId
     * @param orderCode
     * @param ticketTime
     * @return
     */
    ReverseOrder markTicket(Long orderId, String orderCode, Date ticketTime);

    /**
     * 删除
     * @param orderId
     */
    void delete(Long orderId);

    /**
     * 标记核销
     * @param orderId
     * @return
     */
    ReverseOrder markConsumed(Long orderId);

    /**
     * 标记退款
     * @param orderId
     * @param refundCode
     */
    ReverseOrder markRefund(Long orderId, String refundCode);

    /**
     *
     * 创建订单
     * @param reverseOrderType
     * @param loginId
     * @return
     */
    ReverseOrder create(ReverseOrderType reverseOrderType, Long loginId);

    /**
     * 修改订单详情
     * @param orderId
     * @param primaryAgentCompanyId
     * @return
     */
    ReverseOrder editOrderInfo(Long orderId, Long primaryAgentCompanyId);

    /**
     * 验证发送给客户的订单
     * @param reverseOrderId
     * @return
     */
    ReverseOrder verifySendToClientOrder(Long reverseOrderId);

    /**
     *
     * @param orderId
     * @param passportPicCode
     * @return
     */
    AviationRequest.AviationUserInfo loadAviationUserInfo(Long orderId, String passportPicCode);

    /**
     * 修改
     * @param orderId
     * @param aviationUserInfo
     */
    void editAviationUserInfo(Long orderId, AviationRequest.AviationUserInfo aviationUserInfo);

    /**
     * 添加
     * @param orderId
     * @param aviationUserInfo
     */
    void addAviationUserInfo(Long orderId, AviationRequest.AviationUserInfo aviationUserInfo);

    /**
     * 发送客户
     * @param reverseOrderId
     */
    void sendToClient(Long reverseOrderId);

    /**
     * 重新设置价格
     * @param orderId
     * @param raisePrice
     * @param costPrice
     * @param lastPayTime
     * @return
     */
    ReverseOrder resetPrice(Long orderId, BigDecimal raisePrice, BigDecimal costPrice, Date lastPayTime);

    /**
     * 删除乘机人
     * @param orderId
     * @param picCode
     */
    void deleteAviationUserInfo(Long orderId, String picCode);

    /**
     *
     * @param code
     * @return
     */
    List<Object[]> listPaymentContext(String code);
}
